Test Series - java script

Test Number 45/92

Q: Which is not a form of client-side storage?
A. Web Databases
B. FileSystem API
C. Offline Web Applications
D. Online Web Applications
Solution: Client-side storage allows the creater to store data on the users system for faster loading of the website. The various forms of client-side storage are web databases, filesystem API, Offline web applications and cookies.
Q: Which is the storage that allows the caching of web pages and their associated resources?
A. Web Databases
B. FileSystem API
C. Offline Web Applications
D. Cookies
Solution: HTML5 defines an “Offline Web Applications” API that allows the caching of web pages and their associated resources (scripts, CSS files, images, and so on). This is client-side storage for web applications themselves rather than just their data, and it allows web apps to install themselves so that they are available even when there is no connection to the Internet.
Q: Which is Microsoft’s own proprietary client-side storage?
A. IE User Data
B. Offline Web Applications
C. Cookies
D. Offline Apis
Solution: Microsoft implements its own proprietary client-side storage mechanism, known as “userData,” in IE5 and later. userData enables the storage of medium amounts of string data and can be used as an alternative to Web Storage in versions of IE before IE8. This makes loading of programs and software faster.
Q: Which object supports Filesystem API?
A. Element
B. File
C. Window
D. DOM
Solution: These objects can be obtained from the filesystem property on any file system entry. Some browsers offer additional APIs to create and manage file systems, such as Chrome’s requestFileSystem() method.
Q: Which is the most appropriate database for developers requiring a huge amount of data?
A. Database
B. Datawarehouse
C. Web databases
D. Access
Solution: Developers who need to work with really huge amounts of data like to use databases, and the most recent browsers have started to integrate client-side database functionality into their browsers. Client data base helps in making the website faster and handling the data easier.
Q: The localStorage and sessionStorage belongs to ___________
A. Window object
B. Element object
C. Hash object
D. DOM object
Solution: Browsers that implement the “Web Storage” draft specification define two properties on the Window object: localStorage and sessionStorage. Local storage and Session storage are the web storage objects. Session storage is destroyed once the user closes the browser whereas, Local storage stores data with no expiration date.
Q: What is the main difference between localStorage and sessionStorage?
A. Lifetime
B. Scope
C. Both Lifetime and Scope
D. Storage Location
Solution: The difference between localStorage and sessionStorage has to do with lifetime and scope: how long the data is saved for and who the data is accessible to. Session storage is destroyed once the user closes the browser whereas, Local storage stores data with no expiration date.
Q: What is the lifetime of the data stored through localStorage?
A. Permanent
B. Temporary
C. Both Permanent and Temporary at times
D. Cannot store
Solution: Data stored through localStorage is permanent. it does not expire and remains stored on the user’s computer until a web app deletes it or the user asks the browser (through some browser-specific UI) to delete it. This data is stored on the client side server and is used for faster access of data.
Q: Which is the function used to retrieve a value?
A. get()
B. retrieve()
C. getItem()
D. retrieveItem()
Solution: To retrieve a value, pass the name to getItem(). The getItem() method of the Storage interface, when passed a key name, will return that key’s value, or null if the key does not exist, in the given Storage object.
Q: Which is the function used to store a value?
A. setItem()
B. set()
C. storeItem()
D. store()
Solution: To store a value, pass the name and value to setItem(). The setItem() method of the Storage interface, when passed a key name and value, will add that key to the given Storage object, or update that key’s value if it already exists.

You Have Score    /10